package simple.engine.managers;

import java.util.HashMap;
import javax.microedition.khronos.opengles.GL10;

import simple.engine.objects.Texture2D;
import android.graphics.Bitmap;

public class TextureManager {
	
	private static HashMap<String, Texture2D> mHashMap = new HashMap<String, Texture2D>();
	
	// Methods (static)
	
	public static Texture2D loadTexture(GL10 gl, String id, Bitmap bitmap)
	{
		Texture2D internalTex = new Texture2D(gl, bitmap);
		
		if(!mHashMap.containsKey(id))
		{
			mHashMap.put(id, internalTex);
			return internalTex;
		}
		else return null;
	}
	
	public static Texture2D getTexture(String id)
	{
		return mHashMap.get(id);
	}
}
